<% if proposal.rejected? %>
  <div></div>
<% else %>
  <% if !current_user %>
    <% if current_settings.votes_blocked? %>
      <button type="button" name="button" class="column button button--sc disabled" disabled id="proposal-<%= proposal.id %>-votes-count">
        <%= proposal.proposal_votes_count || 0 %>
      </button>
    <% else %>
      <button type="button" name="button" class="column button button--sc" id="proposal-<%= proposal.id %>-votes-count">
        <%= proposal.proposal_votes_count || 0 %>
      </button>
    <% end %>
  <% else %>
    <% if proposal_voted_by_user?(proposal) %>
      <button type="button" name="button" class="column button success button--sc" id="proposal-<%= proposal.id %>-votes-count">
        <%= proposal.proposal_votes_count || 0 %>
      </button>
    <% else %>
      <% if proposal.maximum_votes_reached? && !proposal.can_accumulate_votes_beyond_threshold && current_component.participatory_space.can_participate?(current_user) %>
        <button type="button" name="button" class="column button button--sc disabled" disabled id="proposal-<%= proposal.id %>-votes-count">
          <%= proposal.proposal_votes_count || 0 %>
        </button>
      <% else %>
        <% if vote_limit_enabled? && remaining_votes_count_for_user == 0 %>
          <button type="button" name="button" class="column button button--sc" disabled id="proposal-<%= proposal.id %>-votes-count">
            <%= proposal.proposal_votes_count || 0 %>
          </button>
        <% elsif current_settings.votes_blocked? || !current_component.participatory_space.can_participate?(current_user) %>
          <button type="button" name="button" class="column button button--sc disabled" disabled id="proposal-<%= proposal.id %>-votes-count">
            <%= proposal.proposal_votes_count || 0 %>
          </button>
        <% else %>
          <button type="button" name="button" class="column button button--sc" id="proposal-<%= proposal.id %>-votes-count">
            <%= proposal.proposal_votes_count || 0 %>
          </button>
        <% end %>
      <% end %>
    <% end %>
  <% end %>
<% end %>
